{include file="admin/top.php" subject='supplieProducts'}
{include file="supplieProducts/top.php" subject='supplieProducts'}
<div id="content">
  <form method="post">
  {supplieProducts limit=1 id=$segment.id}
  	<input name="productid" type="hidden" id="productid" value="{$products.product_sku_id}" size="30"/>
    <table width="100%" border="0" cellpadding="5" cellspacing="0" id="editor">
        <tr>
        <td class="title">产品供应商:<br/><br/><select name="shopid" onchange="$('[shopid]').hide();$('[shopid='+this.value+']').show();">{shops}<option value="{$shops.id}" {if $shops.id==$products.shopid}selected{/if} {if 1==$shops.disabled}disabled{/if}>{$shops.title}</option>{/shops}</select></td>
        <td class="content">
        	<select name="supplier" multiple="multiple" size="10" style="height: auto;">
        		{foreach from=$suppliers item=item}
        			<option value="{$item.id}" {if $item.id == $products.supplieid}selected{/if} shopid="{$item.shopid}" style="{if $products.shopid!=$item.shopid}display:none;{else}{/if}">{$item.title}</option>
        		{/foreach}
        	</select>按住ctrl多选
        </td>
        <td class="content"> {if $errors.empty_supplier}<span class="warning">请指定供应商</span>
        {else}指定供应商
        {/if}</td>
      </tr>
      <tr>
        <td width="100" class="title">产品名称:</td>
        <td width="240" class="content"><input name="product" type="text" id="product" value="{$smarty.post.product|default:$products.pname:1}" size="30" readonly="true"/> *</td>
        <td width="821" class="content">填写产品的名称</td>
      </tr>
      <tr style="display:none;">
        <td class="title">产品ID:</td>
        <td class="content"><input name="productid" type="text" id="productid" value="{$products.product_sku_id}" size="30"/></td>
        <td class="content">&nbsp;</td>
      </tr>
      <tr>
        <td class="title">产品规格:</td>
        <td class="content"><input name="spec" type="text" id="spec" value="{$smarty.post.spec|default:$products.spec:1}" size="30"  disabled="true"/></td>
        <td class="content">填写产品规格, 如 50g，200ml等</td>
      </tr>
      <tr>
        <td class="title">采购单价:</td>
        <td class="content">
        	<input name="pricebuy" type="text" id="pricebuy" value="{$smarty.post.pricebuy|default:$products.pricebuy}" size="30" update_price=1/>
        	<select name="currency_unit">
        		<option value="">---请选择---</option>
        		{foreach from=$currency_unit_arr item=culist}
        		<option value="{$culist.unit_en}" {if $products.currency_unit==$culist.unit_en}selected{/if}>{$culist.unit_name}</option>
        		{/foreach}
        	</select>
        	 *
        </td>
        <td class="content">{if $errors.empty_pricebuy}<span class="warning">采购单价不能为空</span>
        {else}填写采购单价<span class="warning">(请选择正确的货币单位)</span>
        {/if} </td>
      </tr>
      <tr>
        <td class="title">供应商库存:</td>
        <td class="content"><input name="stock" type="text" id="stock" value="{$smarty.post.stock|default:$products.stock}" size="30" /> </td>
        <td class="content">允许销售的库存数</td>
      </tr>
      <tr>
        <td class="title">供应商最大库存:</td>
        <td class="content"><input name="stock_base" type="text" id="stock_base" value="{$smarty.post.stock_base|default:$products.stock_base_num}" size="30" /> </td>
        <td class="content">允许销售的最大库存数</td>
      </tr>
      <tr class="noline">
      	<td class="title">供应商产品编号:</td>
      	<td class="content"><input name="sbarcode" type="text" id="sbarcode" value="{$smarty.post.sbarcode|default:$products.sbarcode}" size="30"/></td>
        <td class="content">填写产品条码数字, 如 4711161741799等</td>
      </tr>
      <tr>
      	<td class="title">状态:</td>
        <td class="content">
        	<input name="status" type="radio" id="status" value="-3" {if $products.status==-3}checked{/if}/>下架
        	<input name="status" type="radio" id="status" value="1" {if $products.status==1}checked{/if}/>上架
    	</td>
        <td class="content">&nbsp;</td>
      </tr>
      <tr>
      	<td class="title">是否默认:</td>
        <td class="content">
        	<input name="is_default" type="radio" id="is_default" value="0" {if $products.is_default==0}checked{/if}/>否
        	<input name="is_default" type="radio" id="is_default" value="1" {if $products.is_default==1}checked{/if}/>是
    	</td>
        <td class="content">&nbsp;</td>
      </tr>
    </table>
    
    <div class="fr mt10">
    <input type="submit" value="确定" class="btn" />
    <a href="javascript:window.history.go(-1);" class="btn">取消</a> 
    <input name="id" type="hidden" id="id" value="{$products.id}" />
    <input name="referer" type="hidden" id="referer" value="{$smarty.post.referer|default:$smarty.server.HTTP_REFERER:1}" />
    <input name="action" type="hidden" id="action" value="modify" />
    </div>
	{/supplieProducts}
	
  </form>
</div>
<script type="text/javascript">
{include file="admin/bottom.php"}
</body>
</html>
